﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Main.aspx.cs" Inherits="Main" Title="Main" ViewStateMode="Disabled" %>

<%@ Register Src="WebControls/NewsItem.ascx" TagName="NewsItem" TagPrefix="bn" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <br />
    <br />
    <asp:ListView ID="lvNews" runat="server" DataSourceID="ldsNewsItems" DataKeyNames="NewsItemID">
        <LayoutTemplate>
            <div id="itemPlaceholder" runat="Server">
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <bn:NewsItem ID="NewsItemMain" runat="server" NewsItem='<%# Container.DataItem %>'
                DeleteCommandName="Delete" ShowCommentsLink="true" />
        </ItemTemplate>
    </asp:ListView>
    <asp:LinqDataSource ID="ldsNewsItems" runat="server" ContextTypeName="BusinessLogic.Model.BlogNETDataContext"
        TableName="NewsItems" AutoSort="false" OnSelecting="ldsNewsItems_Selecting" OnDeleted="ldsNewsItems_Deleted"
        EnableDelete="true">
    </asp:LinqDataSource>
    <asp:DataPager ID="dpNews" PageSize="5" PagedControlID="lvNews" runat="server" QueryStringField="Page">
        <Fields>
            <asp:NextPreviousPagerField FirstPageText="First" PreviousPageText="Previous" ShowPreviousPageButton="true"
                ShowFirstPageButton="true" ShowNextPageButton="false" ButtonCssClass="pager_next_previous" />
            <asp:NumericPagerField ButtonCount="10" NextPageText="..." PreviousPageText="..."
                CurrentPageLabelCssClass="pager_current_page" NumericButtonCssClass="pager_numeric" />
            <asp:NextPreviousPagerField LastPageText="Last" NextPageText="Next" ShowNextPageButton="true"
                ShowLastPageButton="true" ShowPreviousPageButton="false" ButtonCssClass="pager_next_previous" />
        </Fields>
    </asp:DataPager>
    <br />
    <br />
</asp:Content>
